Repository navigation
feat(phase2): architecture layer — state machine, combat, traits, death messages, editor setup - #3
Merged
Merged
Conversation
… double-save, scene wait
…me, double-emit, pattern-fail, optimistic-emit, lazy lookup, boss detection, state divergence, GameConfig constants, Invoke cancel
…or damage or group
…not aggroed count
…ameConfig constants, ServiceLocator registration
…yAI.IsAwareOfPlayer; live query at death
…ict per death type
…journal keys, trait delta logging, Bootstrap setup script
…sSortMode obsolete, _shrineId wired to WorldManager
…e, FindObjectsSortMode, Finalize name, ShrineId wired
…field names (_maxHp, _attackDamage), extract shared EnsureTag utility
…com.unity.ai.navigation
…Fenrir → Setup Project
…x Unity version 6000.4.9f1
…ported in CI Unity 6 Personal dropped .ulf manual activation and Hub OAuth cannot be scripted. Unity build + EditMode tests run locally via Test Runner. Lint-docs gate remains. Job skeleton preserved in comments for future Pro/serial upgrade path.
…avMeshAgent push Enemy was spawning at (5,5) — 7.07u from player, inside 8f detection radius. Immediate aggro on frame 1 caused the enemy to run into the player's CharacterController. Moved to (0,0,14) so the player can move freely before engaging. Added LowQuality obstacle avoidance to prevent agent from physically pushing the CharacterController.
…ics layers SpawnAshWolf early-return guard was keeping the old (5,5) position across re-runs. Now destroys and recreates every run so position stays in sync. Added EnsureLayer + SetLayerCollision to FenrirEditorUtils. Player and Enemy are on separate physics layers with collision ignored — prevents the NavMeshAgent CapsuleCollider from pushing the CharacterController.
Physics.IgnoreLayerCollision called before TagManager refreshes returns layer index -1, throwing ArgumentException. Removed layer machinery. Instead mark the enemy CapsuleCollider as isTrigger=true so the NavMeshAgent never physically pushes the player CharacterController. Hit detection works via trigger overlap, not solid collision.
Library wipe disconnects Graphics Settings from Mobile_RPAsset, causing 999+ shader-not-found errors and a black scene. EnsureURPAsset() now reassigns it as step 0 of Setup Project so it self-heals without manual intervention in Project Settings → Graphics.
…GameController tags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full Phase 2 architecture layer on top of the Phase 1 scaffold.
Core systems
SceneRouter— async typed scene navigation, owns AppState/GameStateAppStateMachine— PlayerState with validated transition tableGameLoop— pause/resume, debounced auto-save on app background, scoped bus clear on full scene transitions only (additive sub-zone unloads don't wipe trait subscriptions)Bootstrap— StreamingAssets JSON config loading, re-subscribes TraitAccumulator after every scene loadCombat
CombatContext— live aggroed-enemy count viaEnemyAI.IsAwareOfPlayer, damage-dealt tracking per enemyCombatSystem— boss detection viaEnemyArchetype.Boss, lazy PlayerCombat lookupAttackResolver— usesGameConfigconstants, no duplicated magic numbersEnemyAI— player cached inStart(),EnemyCombatcached inAwake(),IsAwareOfPlayerpublic propertyDeath system
DeathSacrificeEvent— triggers when player attacked at low HP and (group ≥ 2 aggroed enemies OR dealt < 25% of any enemy's max HP)DeathMessageProvider— dramatic two-line contextual messages per death type with group/minor-damage variant split for SacrificeGameConfig— zero hardcoded numbersFixes across 4 audit passes
ISaveManager.IsDirtymissing from interfaceBehaviorEventBusdouble-emit onHitTakenNoDodgeEventDateTimefields not serializable byJsonUtility→longUnix timestampsWorldManagerstatic singleton → ServiceLocatorEnemyAI.FindPlayer()in Update loop → cached in StartKeyboard.current == nullguard on deviceAwakeningSequencerusedSceneManagerdirectly instead ofSceneRouterEnemyCombatpassed enemy element as player defender element_consecutiveDeathsVsSameEnemynot keyed by enemy IDEditor tooling
FenrirSetup.cs— singleFenrir → Setup Projectreplaces 7 separate scripts. Registers tags, configures all 3 scenes, wires all references, spawns Ash Wolf, bakes NavMesh. Idempotent.FenrirEditorUtils.cs—EnsureTag()writes directly toTagManager.assetvia SerializedObjectTest plan
Fenrir → Setup Projectin Unity Editor — 0 errors, all scenes saved[Traits] DodgeUsedEvent Patience: +2.0DeathPatternFailEventin Console